<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

</head>
<body>
over_time:
<input id="over_time" placeholder="time"><br>
text_name:
<input id="text_name" placeholder="text_name"><br>
<button id="button">button</button>
<script>
   $("#button").click(function () {
        $.ajax({
            url: '/upload',
            type: "POST",
            dataType: 'json',
            data: {
                over_time: $("#over_time").val(),
                text_name: $("#text_name").val(),
            },
            success: function (result) {
                alert('cg')
                console.log(result)
                window.open('/index', '_self')

            },
            error: function () {
                 window.open('/index', '_self')
                console.log('shibai')
            },
        });
    })

</script>
</body>
</html>